think like this,
If the interval [s, e] can only be overwritten by one sprinkler, The subinterval [0, M] (s
Because if [0, M] is completely overwritten, the [s, e] interval will be split, so we can mark the [s, e,
One of the more convenient encoding methods is to directly mark the dp array with a special value. My approach is as follows:
[Cpp]Dp [0] = 0;For (int I = 1; I For (int I = 0; I Int s, e;Scanf ("% d", s, e );For (int j = s + 1; j }
Complete code:[Cpp]# Include # Include # Define L
I. Overview
Variables are often used in stored procedures, and the use of variables is an important point of knowledge, especially when defining conditions.
MySQL Version: 5.6
Definition and assignment of variables
#创建数据库
DROP DATABASE IF EXISTS dpro;
CREATE DATABASE dpro
CHARACTER SET UTF8
;
Use Dpro;
#创建部门表
DROP TABLE IF EXISTS Employee;
CREATE TAB
| Reads SQL DATA | Modifies SQL DATA}
| SQL Security {Definer | Invoker}
| COMMENT ' string '
routine_body:
Valid SQL PROCEDURE statement or statements
The grammar comes from the official reference manual, the characteristic grammar block is the place which needs to notice, first uses one example to introduce.
Example:
#创建数据库
DROP DATABASE IF EXISTS dpro;
CREATE DATABASE dpro
CHARAC
difference is that the function must have a return value, and the parameters of the function only in the type and stored procedure has in , out,inout of the three types. Example: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #创建数据库 DROP DATABASE IF EXISTS dpro; CREATE DATABASE Dpro CHARACTER SET UTF8 ; Use Dpro; #创建部门表 DROP TABLE IF E
This article mainly helps you understand MySQL variables and conditions in depth. For more information, see
I. Overview
Variables are often used in stored procedures. the usage of variables is an important knowledge point, especially when defining conditions.
Mysql version: 5.6
II. variable definition and assignment
# CREATE a database drop database if exists Dpro; create database DproCHARACTER SET utf8; USE Dpr
] DETERMINISTIC | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string' routine_body: Valid SQL procedure statement or statements
The syntax comes from the official reference manual. The characteristic syntax block is worth attention. First, we will introduce it with an example.
Example:
# CREATE a database drop database if exists Dpro; create database DproCHARACTER SET utf8; USE
| NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | COMMENT 'string' routine_body: Valid SQL procedure statement or statements
The syntax comes from the official reference manual. The characteristic syntax block is worth attention. First, we will introduce it with an example.
Example:
# CREATE a database drop database if exists Dpro; create database DproCHARACTER SET utf8; USE
OverviewVariables are often used in stored procedures, and the use of variables is an important point of knowledge, especially when defining conditions.MySQL Version: 5.6variable definition and assignment#创建数据库DROP DATABASE IF EXISTS dpro; CREATE DATABASE dprocharacter SET UTF8; Use Dpro; #创建部门表DROP TABLE IF EXISTS Employee; CREATE TABLE Employee (id INT not NULL PRIMARY KEY COMMENT'PRIMARY Key', name VARCH
--public inheritance : 1. Subclass objects can be assigned to parent objects (cut/slice) 2. The parent class object cannot be assigned to a subclass object 3. A pointer/reference to a parent class can point to a subclass object 4. A pointer/reference to a subclass cannot point to the parent class object (can be done by forcing type conversion) Class base{public:base (int data) {}~base () {}private:int _pri;protected:int _pro;public:int _pub;static int count;}; int base::count = 0;cla
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.